<script setup>
import IntelligentIntegrationJiangying1 from './IntelligentIntegration-jiangying-1.vue'
import IntelligentIntegrationJiangying2 from './IntelligentIntegration-jiangying-2.vue'
import IntelligentIntegrationJiangying3 from './IntelligentIntegration-jiangying-3.vue'
import IntelligentIntegrationJiangying4 from './IntelligentIntegration-jiangying-4.vue'
import IntelligentIntegrationJiangying5 from './IntelligentIntegration-jiangying-5.vue'
import IntelligentIntegrationJiangying6 from './IntelligentIntegration-jiangying-6.vue'
import IntelligentIntegrationJiangying7 from './IntelligentIntegration-jiangying-7.vue'
import IntelligentIntegrationJiangying8 from './IntelligentIntegration-jiangying-8.vue'
import IntelligentIntegrationJiangying9 from './IntelligentIntegration-jiangying-9.vue'
import salesBoard3 from '@/views/visual/modules/salesBoard3.vue'

import * as IndustrialComplexService from '@/api/visual/industrialComplex'

const pageData = ref({
  jianying1: {
    config: {},
    key: 1,
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying3: {
    config: {},
    key: 1,
    data: [],
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying4: {
    config: {},
    key: 1,
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying5: {
    config: {},
    key: 1,
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying6: {
    config: {},
    key: 1,
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying7: {
    config: {},
    key: 1,
    tAnimationConfig: {
      Basis: 'x',
      Duration: 2000,
      Length: 99
    }
  },
  jianying8: {
    config: {},
    data: []
  }
})

const loadData = async () => {
  const { data } = await IndustrialComplexService.loadIndustrialComplexJiangYing1()

  const { config1, config2, config3, config4, config5, data8, config6 } = data
  pageData.value.jianying1.config = config1
  pageData.value.jianying3.data = data8
  pageData.value.jianying4.config = config2
  pageData.value.jianying5.config = config3
  pageData.value.jianying6.config = config4
  pageData.value.jianying7.config = config5
  pageData.value.jianying8.data = config6
}

onMounted(loadData)
</script>

<template>
  <div class="IntelligentIntegration5">
    <div class="dom1">
      <IntelligentIntegrationJiangying1 :options="pageData.jianying1.config"></IntelligentIntegrationJiangying1>
      <div class="tag tag1">销售</div>
    </div>
    <div class="dom2">
      <salesBoard3></salesBoard3>
      <!-- <IntelligentIntegrationJiangying2></IntelligentIntegrationJiangying2> -->
    </div>
    <div class="dom3">
      <IntelligentIntegrationJiangying3></IntelligentIntegrationJiangying3>
      <div class="tag tag3">安全</div>
    </div>
    <div class="dom4">
      <IntelligentIntegrationJiangying4 :options="pageData.jianying4.config"></IntelligentIntegrationJiangying4>
      <div class="tag tag4">采购</div>
    </div>
    <div class="dom5">
      <IntelligentIntegrationJiangying5 :data="pageData.jianying3.data"></IntelligentIntegrationJiangying5>
    </div>
    <div class="dom6">
      <IntelligentIntegrationJiangying6 :options="pageData.jianying5.config"></IntelligentIntegrationJiangying6>
    </div>
    <div class="dom7">
      <IntelligentIntegrationJiangying7 :options="pageData.jianying6.config"></IntelligentIntegrationJiangying7>
      <div class="tag tag5">库存</div>
    </div>
    <div class="dom8">
      <IntelligentIntegrationJiangying8 :options="pageData.jianying7.config"></IntelligentIntegrationJiangying8>
      <div class="tag tag5">生产</div>
    </div>
    <div class="dom9">
      <IntelligentIntegrationJiangying9 :data="pageData.jianying8.data"></IntelligentIntegrationJiangying9>
      <div class="tag tag5">能耗</div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.IntelligentIntegration5 {
  flex: 1;
  width: 100%;
  height: 100%;
  display: grid;

  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;

  .dom1,
  .dom3,
  .dom4,
  .dom5,
  .dom6,
  .dom7,
  .dom9,
  .dom8 {
    min-height: 0;
    // overflow: hidden;
    position: relative;
  }

  .dom2 {
    height: 100%;
    grid-column: 2 / 4;
    grid-row: 1/3;
  }

  .dom2-content {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 120px 1fr;
    min-height: 0;
    overflow: hidden;
  }

  .tag {
    position: absolute;
    color: #fff600;
    text-align: center;
    line-height: 90px;
    font-size: 18px;
    font-weight: bold;
    width: 90px;
    height: 90px;
    background: url(../../../assets/image/ld-loading.gif);
    background-size: contain;
  }
  .tag1 {
    top: 50%;
    right: -45px;
    transform: translateY(-50%);
  }
  .tag3 {
    bottom: -45px;
    left: -45px;
  }
  .tag4 {
    right: -45px;
    top: 50%;
    transform: translateY(-80%);
  }

  .tag5 {
    top: -45px;
    left: -45px;
  }
}
.dom-box {
  display: flex;
  flex-direction: column;
  height: 100%;

  .dom-title {
    height: 40px;
    background-color: rgba(14, 58, 119, 0.6);
    color: #2ca7e2;
    line-height: 40px;
    padding-left: 20px;
  }

  .dom-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .chart-content {
    flex: 1;
    overflow: hidden;

    height: calc(100% - 70px);
  }
}

:deep(.my-box7.dv-border-box-7) {
  box-shadow: initial !important;
}
</style>
